/*
 * Copyright 2022 The Kubernetes Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import 'mixins';
@import '../Text/mixins';
@import '../Progress/mixins';
@import '../Terminal/mixins';

@include Wizard {
  display: flex;
  flex-direction: column;

  @include CollapsedHeader {
    @include WizardHeader {
      padding-top: 1.375em;
      padding-bottom: 1.375em;

      @include MarkdownMajorParagraph {
        --kui--markdown-major-paragraph-margin: 1.25em;
      }

      @include WizardDescription {
        display: none;
      }
    }

    @include WizardTitle {
      font-size: var(--pf-global--FontSize--xl);
      margin-bottom: 0.5em;
    }
  }
}

@include WizardHeaderActionButtons {
  position: absolute;
  top: 1em;
  right: 1em;
}

@include WizardHeader {
  position: relative;
  padding: 1.5em;
}

@include Wizard {
  @include WizardDescription {
    padding-top: 0.5em;
    & > {
      @include TextContent {
        & > {
          @include Markdown {
            & > p {
              font-size: 1rem;
            }
          }
        }
      }
    }
    p:first-child {
      margin-top: 0;
    }
  }
}

/** Place wizard header progress title beside bar */
@include Wizard {
  @include WizardTitle {
    margin: 0;
  }

  @include WizardHeader {
    @include WizardProgress {
      grid-template-rows: 1fr;
      grid-template-columns: 7em 1fr 3em;

      @include ProgressDescription {
        text-align: right;
        grid-row: 1;
        grid-column: 1;
      }
      @include ProgressBar {
        grid-row: 1;
        grid-column: 2;
      }
      @include ProgressStatus {
        grid-row: 1;
        grid-column: 3;
        line-height: normal;
        white-space: nowrap;
      }
    }
  }
}
